NetCloak 2.5 User's Guide

Counter Commands


<INSERT_COUNT counter>

INSERT_COUNT will place an incremental number in the document. The number increases by one each time the command is executed.

The "counter" field allows you to specify different names for different counters. A name is not required, but is used so that you can maintain individual page counters. NetCloak will track the value of counters with different names seperately. If no "counter" is specified, then a default counter is used. The counter name is not case sensitive.

Here is an example:

     Cloaked documents served: <INSERT_COUNT>     <P>     This page served: <INSERT_COUNT ThisPage>

You could include this example in any number of cloaked documents, changing the counter name "ThisPage" in each document. The first counter in this example (without the counter name) would be incremented each time any of these pages was accessed, whereas the second counter would be incremented for each individual page.

To display a counter without updating it, use the variation <INSERT_COUNT#>. For example:

     This document served: <INSERT_COUNT MyPage>     <P>     That's <INSERT_COUNT# MyPage> times!
     <P>     <INSERT_COUNT# MyPage> is quite a few times!
     <P>     The Home Page has been accessed <INSERT_COUNT#> times.

This page would only increment the "MyPage" counter once, and would not increase the default counter (used, in this case, for the "Home Page") at all.

You can also increment counters without displaying them by using the variation <INSERT_COUNT*>. This allows you to increment counters on each page of your server and then display them on a separate statistics page.

Counters may be preset to any value using the "Counters" tab of the "Lists" window. See the "Configuring NetCloak" section below for details. When you define a counter in the Lists window, you can also have the counter automatically reset itself at specified intervals.

NetCloak limits the number of individual counters to 512. See the section "Adjusting Internal Settings" for information on how this limit can be increased, if necessary.

<HIDE_COUNT lowvalue highvalue counter>

In addition to displaying page counters, you can show and hide based on their values. HIDE_COUNT checks the counter specified by "counter" to see if it falls within the range defined by "lowvalue" and "highvalue". Here is an example...

     This document served <INSERT_COUNT MyPage> times.
     <BR>     <HIDE_COUNT 0 50 MyPage>     This line will be shown only after the page has been accessed 50 times.

Note that the HIDE_COUNT command does not increment the counter, so you will normally need to use this command in conjunction with either INSERT_COUNT or INSERT_COUNT*.

<SHOW_COUNT lowvalue highvalue counter>

This command is the SHOW version of the count commands. See HIDE_COUNT for details on how it works. The SHOW_COUNT command works exactly the same way, except that text becomes shown instead of hidden. For example, the following section would give a special note to the 100th person accessing your site:

     <INSERT_COUNT* Winner>     <HIDE><SHOW_COUNT 100 100 Winner>     You are lucky caller number 100!
     <SHOW>

<INSERT_COUNTERDATE counter offset format>

Counters are commonly reset occasionally, and NetCloak can do this for you at predefined intervals. To create a counter that periodically resets, see the "Configuring NetCloak" section below.

When a counter resets, you may want to display the date the counter started. The INSERT_COUNTERDATE command gives you an easy way to do this. For example:

     There have been <INSERT_COUNT PageHits> visitors
     to this page since <INSERT_COUNTERDATE PageHits>.

When the counter "PageHits" is reset by NetCloak, the page will be automatically updated to display the date the counter was reset.

The optional "offset" parameter allows you to display the date offset from the current date and time. This is useful for displaying the date in another time zone. The offset must be preceded by a "+" for a forward offset or "-" for a backwards offset, and is specified in hours and tenths of hours. For example,

     <INSERT_COUNTERDATE PageHits +3.5>

The optional "format" parameter is used to control how the date appears. If needed, use "LONG" for the long representation of the date, and "SHORT" for the short representation. The format may be specified without specifying an offset. For example,

     <INSERT_COUNTERDATE PageHits SHORT>

See the INSERT_DATE command for more examples and sample dates in each format.

<INSERT_COUNTERTIME counter offset format >

The INSERT_COUNTERTIME has the same purpose and functions in the same way as the INSERT_COUNTERDATE command above. Of course, instead of displaying the date a counter was last reset, this command displays the exact time. To expand on the example above:

     There have been <INSERT_COUNT PageHits> visitors to this page since
     <INSERT_COUNTERTIME PageHits> on <INSERT_COUNTERDATE PageHits>.

Like the INSERT_TIME command, an "offset" can be specified as a number of hours difference between the system date of the server and the time to be displayed. The optional "format" parameter can also be used to tell NetCloak whether seconds should be displayed or not. See the INSERT_TIME command for more details.


[ Command Listing | Table Of Contents ]

Copyright © 1996-7 Maxum Development Corporation
820 South Bartlett Road - Suite 104
Streamwood, IL 60107
http://www.maxum.com/